/** 使用了主题功能就不能使用 http://192.168.208.1:8084/yxUi/style/yx-common.css cdn会导致样式冲突 ***/
import cache from '@/utils/cache'
export const setTheme = async () => {
  const { value = 1 } = cache.getCache('portal_type_is_inner') || {}
  let theme = 'default-theme'
  if (parseInt(value) === 0) {
    theme = 'orange-theme'
  } else if (cache.getCache('theme')) {
    theme = cache.getCache('theme')
  }
  await import('yaoxfly-ui/theme-chalk/theme/' + theme + '.scss')
}

export const setFont = async () => {
  const font = cache.getCache('font') ? cache.getCache('font') : 'small'
  await import('yaoxfly-ui/theme-chalk/font/' + font + '.scss')
}

export const setZoom = async () => {
  const zoom = cache.getCache('zoom') ? cache.getCache('zoom') : '100'
  zoom !== '100' && await import('yaoxfly-ui/theme-chalk/zoom/' + zoom + '.scss')
}

// setFont()
setTheme()
setZoom()
export default {
  // setFont,
  setZoom,
  setTheme
}
